const getters = {
  routes: state => {
    let routes = [...state.permission.menuRoutes]
    routes = routes.filter(item => item.meta)
    routes.sort((value1,value2) => {  // 菜单排序
      if (!value1.meta.index) {
        return -1
      }
      if (value1.meta.index < value2.meta.index) {
        return -1
      } else if (value1.meta.index > value2.meta.index) {
        return 1
      } else {
        return 0
      }
    })
    return routes
  },
  account_code: state => state.finance.account_code,
  userInfo: state => state.user.userInfo,
  gasInfo: state => state.market.gasInfo,
  id: state => state.vipPool.id,
  menuType: state => state.permission.menuType,
  hasMarketRight: state => state.permission.hasMarketRight,
  menuRoutes: state => state.permission.menuRoutes
}

export default getters